package com.fzu.ess.sys.entity;

import com.fzu.ess.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by ercha on 2015/10/16.
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@DynamicInsert @DynamicUpdate
@Table(name = "sys_log")
public class Log extends BaseEntity {
    public Log(String id){
        this.id = id;
    }

    @Column(name = "type")
    private String type;

    @Column(name = "title")
    private String title;

    @Column(name = "remote_addr")
    private String remoteAddr;

    @ManyToOne
    @JoinColumn(name="requestor_id")
    private User user;

    @Column(name = "user_agent")
    private String userAgent;

    @Column(name = "request_uri")
    private String requestUri;

    @Column(name = "method")
    private String method;

    @Column(name = "params")
    private String params;

    @Column(name = "exception")
    private String exception;
}
